//
//  UIColor+Extension.swift
//  SLBlog
//
//  Created by 盼 on 2017/11/23.
//  Copyright © 2017年 pan. All rights reserved.
//

import UIKit

extension UIColor
{
    func colorWithHex(rgb:Int, alpha: CGFloat) -> UIColor {
        return UIColor(red: ((CGFloat)((rgb & 0xFF0000) >> 16))/255.0, green: ((CGFloat)((rgb & 0xFF00) >> 8))/255.0, blue: ((CGFloat)(rgb & 0xFF)) / 255.0, alpha: alpha)
    }
    
    func randomColor() -> UIColor {
        
        return UIColor(displayP3Red: CGFloat(drand48()), green: CGFloat(drand48()), blue: CGFloat(drand48()), alpha: 1.0)
    }
}
